# To change this template, choose Tools | Templates
# and open the template in the editor.
from game.game_data import fov

from game.ai.action import *
from game.ai.attack import *
from game.ai.move import *
from game.ai.open import *
from game.ai.close import *

class ActionManager:
    def __init__(self):
        self.action_list = {}
        self.action_list["move"] = MoveAction()
        self.action_list["attack"] = AttackAction()
        self.action_list["open"] = OpenAction()
        self.action_list["close"] = CloseAction()
        self.action_list["pickup"] = PickupAction()
        self.action_list["bump"] = BumpAction()
        self.action_list["check"] = CheckAction()

    def perform(self, act, sd, src, dst):

        for t in dst:
            r = self.action_list[act].perform(sd, src, t)
            if r is not None:
                self.perform(r, sd, src, [t])

        sd.gui.msg_mgr.rebuild()
        sd.gui.game_area.make_dirty()
